
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
<title>正在抓取文章网址</title>
</head>
<body>
	<div class="page-container">
		<div class="row cl">
			<div class="formControls col-xs-12 text-c" style="margin-bottom: 20px;">
				<h3>正在抓取文章网址</h3>
			</div>
		</div>
		<div class="row cl">
			<div class="content col-md-12">
				<div class="progress" style="margin: 0 auto"><div class="progress-bar"><span class="sr-only" style="width:0%"></span></div></div>
			</div>
		</div>

	</div>
    <script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
    <script>
        var timer = 0;
        $(function () {
            var role = Math.round(Math.random()*10000)
            $.get('/do_collection?id={{ id }}&role='+role,function (data) {
                try{
                    var ojb = JSON.parse(data);
                }catch(err){
                    var ojb = data;
                }
                if (ojb.code==1) {
                    layer.msg('正在抓取文章网址!',{icon:1,time:1000});
                    window.timer = setInterval(function(){
                        $.get('/do_collection_get?role='+role,function (data) {
                            try{
                                var ojb = JSON.parse(data);
                            }catch(err){
                                var ojb = data;
                            }
                            if (ojb.code!=1){
                                $('.sr-only').css('width',ojb.process+'%');
                            }else {
                                $('.sr-only').css('width','100%');
                                clearInterval(window.timer);
                                layer.msg('抓取文章网址完成!',{icon:1,time:1000});
                                location.href="/start_collectionshow?id={{ id }}"
                            }
                        })
                    },500);
                }else{
                    layer.msg(ojb.msg,{icon:5,time:1000});
                }
            })
        })
    </script>
</body>
</html>